import request from '@/utils/request'

// 获取省市区树形结构
export const getRegionData = (data: any): Promise<any> =>
  request.get(`/platform/province/selectTree?signUserLocationId=${data.signUserLocationId}`)

// 获取年份下拉框
export const getYearSelect = (): Promise<any> => request.get('/userManager/getLoginCountYear')

// 获取弹框所属地区结构
export const getModalRegion = (): Promise<any> => request.get('/platform/province/selectTreeToAddAdmin')

// 获取表格数据
export const getList = (data: any): Promise<any> => request.post('/userManager/getAdministratorInfo', data)

// 新增市级管理员接口
export const addCityAdmin = (data: any): Promise<any> => request.post('/userManager/insertCityAdministrator', data)

// 编辑市级管理员接口
export const editCityAdmin = (data: any): Promise<any> => request.post('/userManager/updateCityAdministrator', data)

// 获取病区下拉框筛选
export const getWordSelector = (): Promise<any> => request.post('/wardManage/getWardType')

// 删除市级管理员
export const deleteCityAdmin = (data: any): Promise<any> =>
  request.get(`/userManager/deleteCityAdministrator?id=${data.id}`)

// 导出 ( 全部导出 部分导出 )
export const exportAdminInfoExcel = (data: any): Promise<any> =>
  request.post('/userManager/exportAdminInfoExcel', data, { responseType: 'blob' })
